@echo on

set DB_HOST=192.168.2.21
set DB_PORT=6603
set DB_NAME=hengjin
set DB_USER=root
set PASSWORD=root
set SQL_FILES_DIR=E:\working-items\heng-jin\sql

for %%i in (%SQL_FILES_DIR%\*.sql) do (
    echo Executing: %%i
    mysql -h%DB_HOST% -P%DB_PORT% -u%DB_USER% -p%PASSWORD% %DB_NAME% --default-character-set=utf8< %%i
    echo Exection: %%i
)
echo All SQL files executed.
pause